import React from "react";
import { View, Image } from "@tarojs/components";
import "./GoodsList.scss";
// eslint-disable-next-line import/first
import CheckedIcon from "@/src/static/images/checked.png";
// eslint-disable-next-line import/first
import UnCheckedIcon from "@/src/static/images/un-checked.png";

/* 申请售后商品列表 */

const GoodsList = (props) => {
  const { skuList, clickSku } = props;
  return (
    <View className='list'>
      {skuList.map((sku, idx) => {
        return (
          <View
            key={idx}
            onclick={() => {
              clickSku(idx);
            }}
          >
            <View className='list-item'>
              {sku.ischecked ? (
                <Image className='checked-icon' src={CheckedIcon}></Image>
              ) : (
                <Image className='checked-icon' src={UnCheckedIcon}></Image>
              )}

              <View className='list-right'>
                <Image className='cover' src={sku.goods_cover}></Image>
                <View className='list-right-cont'>
                  <View>
                    <View className='title-font'>{sku.goods_name}</View>
                    <View className='sku-font'>{sku.sku_name}</View>
                  </View>
                  <View className='price-num'>
                    <View className='price-font'>￥{sku.sku_price}</View>
                    <View className='num-font'>x{sku.sku_count}</View>
                  </View>
                </View>
              </View>
            </View>
          </View>
        );
      })}
    </View>
  );
};
export default GoodsList;

